<?php
define('VERSION',time());
//defined('SITEMODE') or define('SITEMODE','DEVELOP');//网站部署模式[DEVELOP|TEST|PRODUCT]
//defined('SITEMODE') or define('SITEMODE','TEST');//网站部署模式[DEVELOP|TEST|PRODUCT]
defined('SITEMODE') or define('SITEMODE','PRODUCT');//网站部署模式[DEVELOP|TEST|PRODUCT]
//defined('SITEMODE') or define('SITEMODE','TEMPORARY');//网站部署模式[DEVELOP|TEST|PRODUCT]

defined('APPVERSION') or define('APPVERSION', isset($_POST['version'])?strtolower($_POST['version']):'');//APP版本号
defined('MOBILEOS')   or define('MOBILEOS', isset($_POST['mobileOS'])?strtolower($_POST['mobileOS']):'');//手机类型：android or ios
defined('CHANNEL')    or define('CHANNEL', isset($_POST['channel'])?strtolower($_POST['channel']):'');//推广渠道
defined('DEVICEID')   or define('DEVICEID', isset($_POST['device_id'])?strtolower($_POST['device_id']):'');//手机设备号
defined('DEVICESERIALID')   or define('DEVICESERIALID', isset($_POST['device_serial_id'])?strtolower($_POST['device_serial_id']):'');//手机设备号2
defined('TOKEN')      or define('TOKEN', isset($_POST['token'])?$_POST['token']:'');//用户token
$config=dirname(__FILE__).'/protected/config/bootstrap.php';
$yii=dirname(__FILE__).'/protected/vendor/Yii/yiilite.php';
switch(SITEMODE)
{
    case 'DEVELOP':
        defined('RECHARGEMARK') or define('RECHARGEMARK','test_');
        defined('YII_DEBUG') or define('YII_DEBUG',true);
        defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',4);
        break;
    case 'TEST':
        defined('RECHARGEMARK') or define('RECHARGEMARK','');
        defined('YII_DEBUG') or define('YII_DEBUG',true);
        defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',4);
        break;
    case 'PRODUCT':
        defined('RECHARGEMARK') or define('RECHARGEMARK','');
        defined('YII_DEBUG') or define('YII_DEBUG',false);
        defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',0);
        break;
    default:
        defined('RECHARGEMARK') or define('RECHARGEMARK','test_');
        defined('YII_DEBUG') or define('YII_DEBUG',true);
        defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',4);
        break;
}

require_once($yii);
Yii::createWebApplication($config)->run();
